package com.jiniutech.common.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.http.HttpStatus;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    /**
     * 返回状态码
     */
    private Integer status = HttpStatus.OK.value();

    /**
     * 返回数据
     */
    private Object data;

    /**
     * 返回消息
     */
    private String message;

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 错误信息栈
     */
    private String errorStackTrace;

    /**
     * 是否成功调用
     */
    private Boolean success;

    public Result(Integer status, Object data, String message, Boolean success) {
        this.status = status;
        this.data = data;
        this.message = message;
        this.success = success;
    }
}
